﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using NHibernate.Mappings;

namespace Apollo.History
{
    [NHibernateEntity(Table = "EmployeeHistory")]
    public class EmployeeHistory : ILegacy
    {
        public EmployeeHistory() { }

        [PrimaryKey]
        public virtual int Id { get; set; }

        [Property]
        public virtual string InternalCode { get; set; }

        [Property(Formula = "(FirstName + ' ' + LastName)")]
        public virtual string FullName { get; set; }

        [Property]
        public virtual string FirstName { get; set; }

        [Property]
        public virtual string LastName { get; set; }

        [Property]
        public virtual string Reason { get; set; }

        [BelongsTo(Column = "ID_Employee")]
        public virtual Employee Employee { get; set; }

        [Property]
        public virtual EmployeeType EmployeeType { get; set; }

        [Property]
        public virtual State State { get; set; }

        [Property]
        public virtual DateTime HireDate { get; set; }

        [Property]
        public virtual DateTime? StartDate { get; set; }

        [Property]
        public virtual DateTime EndDate { get; set; }



        [BelongsTo(Column = "ID_Office")]
        public virtual Office Office { get; set; }

        [BelongsTo(Column = "ID_ReportsTo_Employee")]
        public virtual Employee ReportsTo { get; set; }

        [BelongsTo(Column = "ID_Position")]
        public virtual Position Position { get; set; }

        [Property]
        public virtual string PositionName { get; set; }

        [BelongsTo(Column = "ID_Role")]
        public virtual Role Role { get; set; }

        [Property]
        public virtual string RoleName { get; set; }


        [Property]
        public virtual string LegacyApplication { get; set; }

        [Property]
        public virtual string LegacyID { get; set; }
    }
}
